<template>
    <div id="routeNameIndex" class="container-fluid padding">
        <el-button type="primary" class="fa fa-refresh" @click="sysnic()">开始前端后端的所有功能块同步</el-button>
    </div>
</template>

<script>
    import { constantRouterMap_ } from '@/router'
    export default {
        name: "sysnic",
        methods: {
            sysnic:function () {
                var routes = constantRouterMap_;
                consoleLog(routes)
                var routes_ = [];
                for (var i in  routes){
                    let meta = routes[i]['meta']
                    let title = meta==undefined?'':meta['title']
                    routes_[i] = {id:i,pid:0,show:false,name:title}
                    routes_[i]['children'] = []
                    for (var j in  routes[i]['children']){
                        let meta = routes[i]['children'][j]['meta']
                        let title = meta==undefined?'':meta['title']
                        routes_[i]['children'][j] = {id:j,pid:i,show:false,name:title}
                    }
                }
                this.$message_.postTips(this,'同步','qx-sysnic/sysnic',{nav:JSON.stringify(routes_)});
            },
        }
    }
</script>